//
// Created by wangjunjun on 2024/2/6.
//

#ifndef KEYBOARDMANGER_H
#define KEYBOARDMANGER_H
#include <QWidget>
#include <QApplication>
#include <QKeyEvent>
#include <QWidget>
#include <QTimer>
#include <QObject>
#define  Speed_Max 3

class KeyBoardManger : public QObject{
Q_OBJECT
public:
    explicit KeyBoardManger(QObject *parent = nullptr);

protected:
    //统计键盘的信息状态
    void onKeysMsg();
    //param[in] event:键盘按键按下触发事件，按键包括长按和短按
    //param[in] event:键盘按键按下触发事件，按键包括长按和短按;
    bool eventFilter(QObject *obj, QEvent *event) override;
signals:
    //发送信号键盘按下的信号
    void SenKeyMsg( QString  Msg);
private:
    QTimer *timer;
    int upCount = 0;
    int downCount = 0 ;
    int leftCount = 0;
    int rightCount = 0;

    //云台按键控制
    int m_WKey; // 按键W
    int m_AKey; // 按键A
    int m_SKey; // 按键S
    int m_Dkey; // 按键D
    int m_EnterKey; //按键 Enter
    QString m_Msg ;  //发送信息
};


#endif //WRTELEMTRY_KEYBOARDMANGER_H
